<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test29</title>
</head>
<body>
    <script type="text/javascript">
        test();
        function test() {
            var a = prompt("请输入一个数字");
            if (a<=1){
                return alert(false);
            }else if(a==2){
                return alert(true);
            }
            for(var i = 2; i<a; i++)
            if (a%i!=0){
                return alert(true) ;
            }else {
                return alert(false) ;
            }
        }
    </script>
</body>
</html>